d_no_target <- d %>%
filter(trial_stimulus_type != "target")
data_with_demog %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
xlim(0, 9000)
## Warning: Removed 72 rows containing non-finite values (stat_bin).
## Warning: Removed 2 rows containing missing values (geom_bar).
data_with_demog %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
xlim(0, 9000) +
facet_wrap(~subject)
## Warning: Removed 72 rows containing non-finite values (stat_bin).
## Warning: Removed 134 rows containing missing values (geom_bar).
d %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
xlim(0, 6000)
## Warning: Removed 2 rows containing missing values (geom_bar).
d %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
xlim(0, 6000) +
facet_wrap(~subject)
## Warning: Removed 84 rows containing missing values (geom_bar).
d_no_target %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
xlim(0, 6000)
## Warning: Removed 2 rows containing missing values (geom_bar).
d_no_target %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
xlim(0, 6000) +
facet_wrap(~subject)
## Warning: Removed 84 rows containing missing values (geom_bar).
d %>%
ggplot(aes(x = trial_looking_time,
fill = trial_stimulus_complexity),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000)
d %>%
ggplot(aes(x = trial_looking_time,
fill = trial_stimulus_complexity),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000) +
facet_wrap(~subject)
d %>%
ggplot(aes(x = trial_looking_time,
fill = block),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000)
d %>%
ggplot(aes(x = trial_looking_time,
fill = block),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000) +
facet_wrap(~subject)
d_no_target %>%
ggplot(aes(x = trial_looking_time,
fill = trial_stimulus_complexity),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000)
d_no_target %>%
ggplot(aes(x = trial_looking_time,
fill = trial_stimulus_complexity),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000) +
facet_wrap(~subject)
d_no_target %>%
ggplot(aes(x = trial_looking_time,
fill = block),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000)
d_no_target %>%
ggplot(aes(x = trial_looking_time,
fill = block),
) +
geom_density(alpha = 0.5)+
xlim(0, 6000) +
facet_wrap(~subject)
## Warning: Groups with fewer than two data points have been dropped.
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning -
## Inf
d_sum_individual <- d %>%
group_by(subject, block) %>%
summarise(
mean_lt = mean(trial_looking_time, na.rm = TRUE),
sd = sd(trial_looking_time, na.rm = TRUE),
n = n(),
ci_range_95 = qt(1 - (0.05 / 2), n - 1) * (sd/sqrt(n)),
ci_ub = mean_lt + ci_range_95,
ci_lb = mean_lt - ci_range_95
)
## `summarise()` regrouping output by 'subject' (override with `.groups` argument)
d_sum <- d %>%
group_by(block) %>%
summarise(
mean_lt = mean(trial_looking_time, na.rm = TRUE),
sd = sd(trial_looking_time, na.rm = TRUE),
n = n(),
ci_range_95 = qt(1 - (0.05 / 2), n - 1) * (sd/sqrt(n)),
ci_ub = mean_lt + ci_range_95,
ci_lb = mean_lt - ci_range_95
)
## `summarise()` ungrouping output (override with `.groups` argument)
d_sum %>% ggplot(aes(x = block, y = mean_lt)) +
geom_pointrange(aes(ymin = ci_lb, ymax = ci_ub)) +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
something weird happened
d_sum_individual %>%
ggplot(aes(x = block, y = mean_lt)) +
geom_pointrange(aes(ymin = ci_lb, ymax = ci_ub)) +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
d_sum_individual %>%
ggplot(aes(x = block, y = mean_lt)) +
geom_pointrange(aes(ymin = ci_lb, ymax = ci_ub)) +
facet_wrap(~subject) +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
We can see three very weird ones: SS1604513317537 SS1604515995769 SS1604516882157
weird <- c("SS1604513317537",
"SS1604515995769",
"SS1604516660396")
d_sum_individual %>%
filter(subject %in% weird) %>%
ggplot(aes(x = block, y = mean_lt)) +
geom_pointrange(aes(ymin = ci_lb, ymax = ci_ub)) +
facet_wrap(~subject) +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
d %>%
filter(subject %in% weird) %>%
ggplot(aes(x = trial_looking_time)) +
geom_histogram(bins = 90) +
facet_wrap(~subject) +
xlim(0, 6000)+
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
## Warning: Removed 6 rows containing missing values (geom_bar).
d_no_weird <- d %>%
filter(!(subject %in% weird))
d_no_weird_sum <- d_no_weird %>%
group_by(block) %>%
summarise(
mean_lt = mean(trial_looking_time, na.rm = TRUE),
sd = sd(trial_looking_time, na.rm = TRUE),
n = n(),
ci_range_95 = qt(1 - (0.05 / 2), n - 1) * (sd/sqrt(n)),
ci_ub = mean_lt + ci_range_95,
ci_lb = mean_lt - ci_range_95
)
## `summarise()` ungrouping output (override with `.groups` argument)
d_no_weird_sum %>% ggplot(aes(x = block, y = mean_lt)) +
geom_pointrange(aes(ymin = ci_lb, ymax = ci_ub)) +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
# Basic model
null_m <- lmer(trial_looking_time ~ 1 + (1|subject),
data = d)
basic_m <- lmer(trial_looking_time ~ block + (1|subject),
data = d)
anova(null_m, basic_m)
## refitting model(s) with ML (instead of REML)
## Data: d
## Models:
## null_m: trial_looking_time ~ 1 + (1 | subject)
## basic_m: trial_looking_time ~ block + (1 | subject)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## null_m 3 121133 121154 -60563 121127
## basic_m 6 121126 121167 -60557 121114 13.076 3 0.004474 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
full_aggregated <- d %>%
mutate(
number = 1) %>%
group_by(
subject, block, trial_stimulus_type
) %>%
mutate(num_times_stimulus_seen = cumsum(number))
full_aggregated %>%
filter(trial_stimulus_type == "background") %>%
ggplot(
aes(y = log(trial_looking_time),
x = num_times_stimulus_seen,
color = trial_stimulus_complexity)
) +
geom_point(aes(alpha = 0.2), size = 3, shape = ".") +
guides(alpha = FALSE) +
labs(color = "Stimulus Complexity") +
ylab("Mean Looking Time (log)") +
xlab("Number of Stimulus Reptitions") +
geom_smooth(method = "lm") +
theme(axis.text = element_text(size = 10))
## `geom_smooth()` using formula 'y ~ x'
full_aggregated %>%
filter(trial_stimulus_type == "background") %>%
ggplot(
aes(y = log(trial_looking_time),
x = num_times_stimulus_seen,
color = block)
) +
geom_point(aes(alpha = 0.2), size = 3, shape = ".") +
guides(alpha = FALSE) +
labs(color = "Stimulus Complexity") +
ylab("Mean Looking Time (log)") +
xlab("Number of Stimulus Reptitions") +
geom_smooth(method = "lm") +
theme(axis.text = element_text(size = 10))
## `geom_smooth()` using formula 'y ~ x'
excluded_sum <- full_aggregated %>%
filter(trial_stimulus_type == "background") %>%
filter(!(subject %in% weird))
excluded_sum %>%
ggplot(
aes(y = log(trial_looking_time),
x = num_times_stimulus_seen,
color = trial_stimulus_complexity)
) +
geom_point(aes(alpha = 0.2), size = 3, shape = ".") +
guides(alpha = FALSE) +
labs(color = "Stimulus Complexity") +
ylab("Mean Looking Time (log)") +
xlab("Number of Stimulus Reptitions") +
geom_smooth(method = "lm") +
theme(axis.text = element_text(size = 10))
## `geom_smooth()` using formula 'y ~ x'
excluded_sum %>%
ggplot(
aes(y = log(trial_looking_time),
x = num_times_stimulus_seen,
color = block)
) +
geom_point(aes(alpha = 0.2), size = 3, shape = ".") +
guides(alpha = FALSE) +
labs(color = "Stimulus Complexity") +
ylab("Mean Looking Time (log)") +
xlab("Number of Stimulus Reptitions") +
geom_smooth(method = "lm") +
theme(axis.text = element_text(size = 10))
## `geom_smooth()` using formula 'y ~ x'
full_aggregated %>%
filter(trial_stimulus_type == "background") %>%
ggplot(
aes(y = log(trial_looking_time),
x = num_times_stimulus_seen,
color = trial_stimulus_complexity)
) +
geom_point(aes(alpha = 0.2), size = 3, shape = ".") +
guides(alpha = FALSE) +
labs(color = "Stimulus Complexity") +
ylab("Mean Looking Time (log)") +
xlab("Number of Stimulus Reptitions") +
geom_smooth(method = "lm") +
theme(axis.text = element_text(size = 10)) +
facet_wrap(~subject)
## `geom_smooth()` using formula 'y ~ x'
full_aggregated %>%
filter(trial_stimulus_type == "background") %>%
ggplot(
aes(y = log(trial_looking_time),
x = num_times_stimulus_seen,
color = block)
) +
geom_point(aes(alpha = 0.2), size = 3, shape = ".") +
guides(alpha = FALSE) +
labs(color = "Stimulus Complexity") +
ylab("Mean Looking Time (log)") +
xlab("Number of Stimulus Reptitions") +
geom_smooth(method = "lm") +
theme(axis.text = element_text(size = 10)) +
facet_wrap(~subject)
## `geom_smooth()` using formula 'y ~ x'